<?php

/*
 * 首页控制器
 * @author sky
 * create_time 2017-03-26
 */


namespace App\Front\Controllers\Index;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Intervention\Image\Constraint;
use App\Admin\Controllers\Controller;
use App\Admin\Models\Logs;
use App\Front\Models\Index;



class IndexController extends Controller {


    /*
     * 商品列表
     * @author sky
     * create_time 2017-03-26
     */
    // 商品列表
    public function Index(Request $request) {
    	// echo $request->all();
        $goods1 = Index::index("1");
        $goods2 = Index::index("2");
        $goods3 = Index::index("3");
        // $goods3 = Index::index("4");
        $datas['goods1'] = $goods1;
        $datas['goods2'] = $goods2;
        $datas['goods3'] = $goods3;
        // dd($datas);
        return view('front.index', $datas);
    }

    public function searchs(Request $request) {
        // echo $request->all();
        $search = $request['searchvalue'];
        $goods = Index::searchs($search);
        $datas['goods'] = $goods;
        return view('front.search', $datas);
    }
}
